﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using System.Windows.Media.Imaging;
using System.Diagnostics;
using DotNetImage.Imaging;

namespace DotNetImageTest
{
    class TestSpeed
    {
        [Test]
        [Ignore]
        public void TestTrue()
        {
            DotNetImage.Imaging.DotNetImage img = DotNetImage.Imaging.DotNetImage.FromFile("d:\\rbc.png");

            var timer = System.Diagnostics.Stopwatch.StartNew();
            DotNetImage.Imaging.Filters.GrayScaleFilter filter = new DotNetImage.Imaging.Filters.GrayScaleFilter();

            Run(img, filter, 50);

            img.Save("d:\\test_gamma.jpg", SupportedFileFormat.JPEG);
            Assert.IsTrue(true);

            Debug.WriteLine("***********   GRAY TOOK: " + timer.Elapsed.ToString() + "ms   ************   for 50 runs");
        }

        private void Run(DotNetImage.Imaging.DotNetImage img, FilterBase filter, int count)
        {
            for (int i = 0; i < count; i++)
            {
                FilterCollection col = FilterCollection.Apply(img, filter);
            }
        }
    }
}
